from wsgiref.simple_server import make_server

try:
   from google.appengine.ext import webapp
   from google.appengine.api import users
   from google.appengine.ext.webapp.util import run_wsgi_app
   GAE = True
except:
   GAE = False

from pywilima.departures import scheduleapp


def main():
   if GAE:
      run_wsgi_app(scheduleapp)
   else:
      s = make_server("", 8080, scheduleapp)
      s.serve_forever()


if __name__ == "__main__":
   main()
